package com.cainaer.orders.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.cainaer.orders.domain.OrderReturns;
import com.cainaer.orders.mapper.OrderReturnsMapper;
import com.cainaer.orders.service.IOrderReturnsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 售后表 服务实现类
 * </p>
 *
 * @author Tina
 * @since 2020-09-11
 */
@Service
public class OrderReturnsServiceImpl extends ServiceImpl<OrderReturnsMapper, OrderReturns> implements IOrderReturnsService {

    @Autowired
    private OrderReturnsMapper orderReturnsMapper;

    /**
     * 新增 售后数据
     *
     * @param orderReturns
     * @return
     */
    @Override
    public Integer insertOrderReturns(OrderReturns orderReturns) {
        return orderReturnsMapper.insert(orderReturns);
    }

    /**
     * 编辑 售后数据
     *
     * @param orderReturns
     * @return
     */
    @Override
    public Integer editOrderReturns(OrderReturns orderReturns) {
        return orderReturnsMapper.updateById(orderReturns);
    }

    /**
     * 查询 售后数据
     *
     * @param orderReturns
     * @return
     */
    @Override
    public List<OrderReturns> selectOrderReturns(OrderReturns orderReturns) {
        QueryWrapper queryWrapper = new QueryWrapper();
        return orderReturnsMapper.selectList(queryWrapper);
    }
}
